import type { GreasyForkElements } from '../../../../../../../../../types/constants/personalization/greasy_fork'
import {
  PAGE_ELEMENTS,
  PROJECT_PREFIX,
  SUPPORTED_PLATFORMS,
} from '../../../../../../../../../types/constants'

// 测试链接：https://greasyfork.org/zh-CN/discussions/new?category=requests
export class DiscussionsNewPage {
  elements: GreasyForkElements = PAGE_ELEMENTS[SUPPORTED_PLATFORMS.GREASY_FORK]
  private static instance: DiscussionsNewPage

  /**
   * 获取单例实例
   */
  public static getInstance(): DiscussionsNewPage {
    if (!DiscussionsNewPage.instance) {
      DiscussionsNewPage.instance = new DiscussionsNewPage()
    }
    return DiscussionsNewPage.instance
  }

  init(): void {
  }

  getMainStyles(): string {
    return `
.text-content {
  h3 {
    color: var(--${PROJECT_PREFIX}-theme-text-primary) !important;
    margin-top: 0 !important;
    padding-top: 16px !important;
  }
  .post-discussion {
    .notice {
      background-color: var(--${PROJECT_PREFIX}-theme-info-bg) !important;
      color: var(--${PROJECT_PREFIX}-theme-info-text) !important;
      bottom-left-color: var(--${PROJECT_PREFIX}-theme-info-border) !important;
    }
  }
}
`
  }
}
